package com.team.arms.xitong.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.team.arms.xitong.entity.DicType;
import com.team.arms.xitong.entity.dto.DictUpdateDto;
import com.team.arms.xitong.entity.vo.DictVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Huazige
 * @since 2022-06-24
 */
public interface DicTypeMapper extends BaseMapper<DicType> {


    @Select(" SELECT distinct a.dic_id,a.dic_type_name,a.dic_type_id,b.dic_detail_name,b.dic_detail_id" +
            " from x_dic_type AS a,x_dic_datail as b where a.dic_type_id=b.dic_type_id  " +
            "order by dic_type_id" )
    List<DictVo> select();

    boolean update(DictUpdateDto dictUpdateDto);

    @Select("SELECT IFNULL(MAX(CAST(dic_id AS UNSIGNED)),0) + 1 FROM x_dic_type")
    String getdicTypemax();
}
